import Taro from '@tarojs/taro';
export async function uploadFile(file) {
  var formData = {
    app_id: Taro.getStorageSync('app_id'),
    type: 1,
    file_group: 1
  }
  // 上传文件
  const resdata = await Taro.uploadFile({
    url: 'https://cs.58zltc.com/api/Upload/uploads', //仅为示例，非真实的接口地址
    header:{
      'content-type': 'multipart/form-data',
      'token': Taro.getStorageSync('token') // 上传需要单独处理cookie
    },
    filePath: file.url,
    name: 'image',
    formData: formData,
    complete (res){
      //do something
      return res.data;
    },
  })
  return JSON.parse(resdata.data);
}